package com.hrc.springbootdemo.strategy.controller;

import com.hrc.springbootdemo.strategy.PaperStrategyFactory;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/strategy")
@Slf4j
public class StrategyController {

    @Resource
    private PaperStrategyFactory paperStrategyFactory;

    @RequestMapping("/test")
    public String test(String name) {
       return paperStrategyFactory.getPaperGenerationStrategy(name).getName();
    }

}
